package com.tmxk.employee.constants;

public enum TripModes {
    ONE(1, "自驾"),
    TWO(2, "公司派车"),
    THREE(3,"飞机"),
    FOUR(4,"高铁"),
    FIVE(5,"公共交通"),
    SIX(6,"其他");

    private int code;
    private String value;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    TripModes(int code, String value) {
        this.code = code;
        this.value = value;
    }

    /**
     * 对外提供的公共获取对应枚举类的方法
     */
    public static TripModes getTripModeByCode(int code) {
        switch (code) {
            case 1:
                return ONE;
            case 2:
                return TWO;
            case 3:
                return THREE;
            case 4:
                return FOUR;
            case 5:
                return FIVE;
            case 6:
                return SIX;
            default:
                return ONE;
        }
    }
}
